package com.molichuxing.services.infrastructure.dao;

import com.molichuxing.framework.dao.RootMapper;
import com.molichuxing.services.infrastructure.bean.MaintenanceBean;
import com.molichuxing.services.infrastructure.bean.MaintenanceLogBean;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 保养历史表 Mapper 接口
 * </p>
 *
 * @author xuelin yi
 * @since 2019-09-23
 */
public interface MaintenanceLogMapper extends RootMapper<MaintenanceLogBean> {

    /**
     * 根据条件分页查询count
     * @param map
     * @return
     */
    public int getMaintenanceLogPageCount(@Param("param") Map<String, Object> map);

    /**
     * 根据条件分页查询结果
     * @param map
     * @param pageNum
     * @param pageSize
     * @return
     */
    public List<MaintenanceLogBean> getMaintenanceLogPage(@Param("param") Map<String, Object> map, @Param("pageNum")int pageNum, @Param("pageSize") int pageSize);

    /**
     * 根据车辆id和状态获取保养信息
     * @param carId
     * @param statusList
     * @return
     */
    public List<MaintenanceLogBean> getMaintenanceLogList(@Param("carId") Integer carId, @Param("statusList") List<Integer> statusList);

    /**
     * 创建保养历史
     * @param maintenanceLogBean
     * @return
     */
    int createMaintenanceLog(MaintenanceLogBean maintenanceLogBean);

    /**
     * 更新保养历史
     * @param maintenanceLogBean
     * @return
     */
    int updateById(MaintenanceLogBean maintenanceLogBean);

    /**
     * 根据主键查询保养历史信息
     * @param maintenanceLogId
     * @return
     */
    MaintenanceLogBean getMaintenanceLogById(Integer maintenanceLogId);

    /**
     * 根据主键查询保养历史信息
     * @param maintenanceId
     * @return
     */
    MaintenanceLogBean getMaintenanceLogByPId(Integer maintenanceId);

    /**
     * app保养历史count
     * @return
     */
    int getMaintenanceLogAppCount(@Param("param") Map<String, Object> map);

    /**
     * app保养历史
     * @param pageNum
     * @param pageSize
     * @return
     */
    List<MaintenanceLogBean> getMaintenanceLogAppPage(@Param("param") Map<String, Object> map,@Param("pageNum") Integer pageNum,@Param("pageSize") Integer pageSize);
}
